-
Notifications
You must be signed in to change notification settings - Fork 324
refactor: upgrade to quinn-iroh version with latest qlog & multipath #3725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Description
Whenever we insert a new path, trigger pruning paths.
We currently only prune IP paths, and pruning paths only occurs if we
have more than 30 IP paths.
We will prune any paths that did not successfully holepunch.
If there are still over 30 IP paths left, then we order the "inactive"
paths (paths that have been closed, but at one point holepunched), and
prune the paths that were closed earliest.
## Notes and Questions
- Added constants:
- `MAX_IP_PATHS` = 30 - maximum IP paths per endpoint
- `MAX_INACTIVE_IP_PATHS` = 10 - maximum inactive IP paths to keep
- New `PathState` field:
- `status` - tracks the `PathStatus` of the path
- New `PathStatus` enum:
- `PathStatus::Open` - is an open path
- `PathStatus::Inactive(Instant)` - was opened once, but currently inactive
- `PathStatus::Unusable` - we attempted to use it, but it never connected
- `PathStatus::Unknown` - we don't know the status yet
- New methods on `RemotePathState`:
- `abandoned_path` - marks a path as abandoned with timestamp, triggered when we get the `PathEvent::Abandoned` event
- `prune_paths` - triggers path pruning, occurs whenever we insert a path to the `RemotePathState`
- changed `insert` to `insert_open_path`
- New `prune_ip_paths` function with all the prune logic:
- Only prunes if IP paths exceed `MAX_IP_PATHS`
- Never prunes active paths or paths of unknown status
- Always prunes failed holepunch attempts (PathStatus::Unusable)
- Keeps 10 most recently inactive paths that were previously successful
- Special case: if all paths failed, keeps `MAX_IP_PATHS` instead of pruning everything
- Added tests for edge cases and the typical case
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3725/docs/iroh/ Last updated: 2025-12-04T11:32:26Z |
…ain minimums when used with multipath (#3721) ## Description This PR encapsulates the `quinn::TransportConfig` in a new struct called `QuicTransportConfig`. It has all of the same methods as the `quinn::TransportConfig`, but the follow methods will log warnings if the user given values make iroh + multipath sub-optimal: - default_path_keep_alive_interval() - should be at most `HEARTBEAT_INTERVAL`ms - default_path_max_idle_timeout() - should be at most `PATH_MAX_IDLE_TIMEOUT`ms - max_concurrent_multipath_paths() - should be at least `MAX_MULTIPATH + 1` - set_max_remote_nat_traversal_addresses() - should be at least `MAX_MULTIPATH` These values are also set properly by default when creating a `QuicTransportConfig`. ## quinn encapsulation/co-location Created a new mod `quic` and co-located all the quinn exports there. This would be the mod where we do any future encapsulation. Note: the `StaticConfig` struct is a private struct that still uses `quinn::TransportConfig` directly. closes #3635 ## Breaking Changes - `iroh` - changes - `QuinnTransportConfig` renamed to `QuicTransportConfig` & is now `Clone` - `ConnectOptions::transport_config: Option<Arc<quinn::TransportConfig>>` -> `ConnectOptions::transport_config: Option<QuicTransportConfig> - `ConnectOptions::with_transport_config(mut self, transport_config: Arc<quinn::TransportConfig>)` -> `ConnectOptions::with_transport_config(mut self, transport_config: QuicTransportConfig) ## Open Questions - [x] Need verification that my assumptions about "at least" and "at most" for the above are the correct assumptions about what we want. **done in #3635**
d6dd318 to
ff276d5
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Updates iroh-quinn to n0-computer/quinn#208 which has qlog updated to n0-qlog and changes to the latest qlog drafts and adds support for mulitpath in qlog.
Also added qlog support for a test that has multiple paths. Create the files with:
IROH_TEST_QLOG=1 cargo test -p iroh --lib --features qlog -- endpoint_two_relay_only_becomes_directBreaking Changes
Notes & open questions
Change checklist
quic-rpciroh-gossipiroh-blobsdumbpipesendme